package audi.a4.control.core;

import java.util.ArrayList;

public class AudiA4PacketFactory {
	
	static public AbstractAudiA4Packet getPacket(double timeStamp,AudiA4CanCode code, int ID,ArrayList<String> data){
		switch(code) {
		case AIRBAG_1:
			return new Airbag1Packet(timeStamp, code,ID, data);
		case AIRBAG_2:
			return new Airbag2Packet(timeStamp, code,ID, data);
		case AIRBAG_3:
			return new Airbag3Packet(timeStamp, code,ID, data);
		case AIRBAG_4:
			return new Airbag4Packet(timeStamp, code,ID, data);
		case AIRBAG_5:
			return new Airbag5Packet(timeStamp, code,ID, data);
		case AIRBAG_6:
			return new Airbag6Packet(timeStamp, code,ID, data);
		case ECU_1:
			return new Ecu1Packet(timeStamp, code,ID, data);
		case ECU_2:
			return new Ecu2Packet(timeStamp, code,ID, data);
		case ECU_3:
			return new Ecu3Packet(timeStamp, code,ID, data);
		case ECU_4:
			return new Ecu4Packet(timeStamp, code,ID, data);		
		case ECU_5:
			return new Ecu5Packet(timeStamp, code,ID, data);
		case CLUSTER_1:
			return new Cluster1Packet(timeStamp, code,ID, data);
		case CLUSTER_2:
			return new Cluster2Packet(timeStamp, code,ID, data);
		case CLUSTER_3:
			return new Cluster3Packet(timeStamp, code,ID, data);
		case CLUSTER_4:
			return new Cluster4Packet(timeStamp, code,ID, data);
		case CLUSTER_5:
			return new Cluster5Packet(timeStamp, code,ID, data);
		case CLUSTER_6:
			return new Cluster6Packet(timeStamp, code,ID, data);
		case CLUSTER_7:
			return new Cluster7Packet(timeStamp, code,ID, data);
		case CLUSTER_8:
			return new Cluster8Packet(timeStamp, code,ID, data);
		case CLUSTER_9:
			return new Cluster9Packet(timeStamp, code,ID, data);
		case CLUSTER_10:
			return new Cluster10Packet(timeStamp, code,ID, data);
		case TRANSMISSION_1:
			return new Transmission1Packet(timeStamp, code,ID, data);
		case TRANSMISSION_2:
			return new Transmission2Packet(timeStamp, code,ID, data);
		case UNKNOWN:
			break;
		}
		return new UnknownPacket(timeStamp, code,ID, data);
	}

}
